< previous page page_469 next page >

Page 469
z0489-01.gif
Figure 14.4
Data points used to display a grid (left) and a refined grid (right).
each pair of adjacent grid locations. This makes the drawing on the right follow the surface more precisely.
Figure 14.5 shows three pictures of the same surface. The picture on the left does not use enough data points to follow the surface closely, particularly at the base of the hemisphere.
The middle picture uses twice as many data points, so it follows the surface more closely. This picture does a better job of accurately portraying the surface, but it is cluttered with lines. If there were other objects in the picture, it would be hard to see any that were behind this object.
The picture on the right uses the same number of curves as the one on the left, but it places five intermediate data points between each pair of grid locations. This makes the drawing follow the surface very closely without becoming cluttered.
The easiest way to create this kind of refined grid in Visual Basic is to create a Polyline3d object for each of the curves parallel to the X and Z axes. The Polyline3d class represents a series of points that should be connected and is described in Chapter 13, Three-Dimensional Transformations.
Where a refined grid's curves intersect, the polylines store duplicate information, so this method wastes a little space. If the number of points between grid locations is relatively large, however, the amount of space wasted is only a small percentage of the total space needed. Using polylines in this way also allows you to build refined grids using existing tools rather than by creating a whole new class with new subroutines to debug and maintain.
z0489-02.gif
Figure 14.5
A grid (left), grid with more points (middle), and a refined grid (right).

 
< previous page page_469 next page >